<section class='canal' ng-controller="canalCtrl">
    <div class="panel panel-default">
        <div class="panel-heading">
            渠道管理
        </div>
        <div class="panel-body">
            <form class="form-horizontal" novalidate>
                <div class="form-group" ng-if="canals.length > 0" ng-repeat="(key, canal) in canals track by key">
                    <div class="input-group">
                        <div class="input-group-addon">{{ key + 1 }}</div>
                        <input type="text" class="form-control" ng-model="canal.content" ng-disabled="true" id="exampleInputAmount" placeholder="Amount">
                        <div class="input-group-addon" ng-click="deleteCanal(canal, key);"><i class="icon-delete"></i></div>
                    </div>
                </div>
                <div class="form-group" ng-if="canals.length <= 0">
                    暂无渠道，请添加渠道
                </div>
                <div ng-show="isAdd">
                    <form class="form-horizontal" novalidate>
                        <div class="form-group">
                            <input type="text" class="form-control" ng-model="content" id="exampleInputAmount" placeholder="请输入渠道名">
                        </div>
                        <div class="form-group" ng-if='user_role == 1'>
                            <button type="submit" class="btn btn-mt-ok" ng-click="addCanal(content);">保存修改</button>
                            <button type="submit" class="btn btn-mt-ok" ng-click="cancelCanal();">取消</button>
                        </div>
                    </form>
                </div>

                <div class="form-group from-group-reset">
                    <img src="components/mine/orders/orderdetail/imgs/add.png" alt="" ng-click="isAdd = true;">
                </div>
            </form>
        </div>
    </div>
    <!-- <div class="panel panel-default" ng-show="isAdd">
        <div class="panel-heading">
            渠道添加
        </div>
        <div class="panel-body">
            <form class="form-horizontal" novalidate>
                <div class="form-group">
                    <div class="input-group">
                        <div class="input-group-addon">1</div>
                        <input type="text" class="form-control" ng-model="content" ng-disabled="!isAdd" id="exampleInputAmount" placeholder="请输入渠道名">
                    </div>
                </div>
                <div class="form-group" ng-if='user_role == 1'>
                    <button type="submit" class="yf-shadow btn btn-default yf-btn" ng-click="addCanal(content);">保存修改</button>
                </div>
            </form>
        </div>
    </div> -->
</section>
